<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.ylaihui.pojo.Order" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>08_forEatchList</title>
</head>
<body>
    <%
        ArrayList<Order> orders = new ArrayList<>();
        for (int i = 1; i < 10; i++) {
            orders.add(new Order(i, i + 1.1));
        }
        request.setAttribute("orderlist", orders);
    %>

    <table border="1">
        <tr>
            <th>id</th>
            <th>price</th>
            <th>status</th>
        </tr>
            <c:forEach begin="2" end="8" step="2" varStatus="status" items="${orderlist}" var="ods">
                <tr>
                    <td>${ods.id}</td>
                    <td>${ods.price}</td>
                    <td>${status}</td>
                </tr>
            </c:forEach>
    </table>
</body>
</html>
